package business
{
	import mx.collections.ArrayCollection;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.http.HTTPService;
	
	public class CRUDService
	{
		public function CRUDService()
		{
		}
		public static function getList(
			urlPrefix:String, domainType:String, 
			successCallback:Function, errorCallback:Function
		):ArrayCollection {
			
			var service:HTTPService = new HTTPService( urlPrefix + domainType + ".xml" );
			
			service.method 			= "GET";
			service.resultFormat 	= "e4x";
			service.addEventListener(ResultEvent.RESULT, successCallback);
			service.addEventListener(FaultEvent.FAULT, errorCallback);
			
			service.send();
			
		}
	}
}